Skip to content

feat(analysis): split the density histogram into R, G, B and luminance - #914

Merged
marcinz606 merged 13 commits into
marcinz606:mainfrom
thetalkingdrum:feat/per-channel-density-histogram
Aug 19, 2026
Merged

feat(analysis): split the density histogram into R, G, B and luminance#914
marcinz606 merged 13 commits into
marcinz606:mainfrom
thetalkingdrum:feat/per-channel-density-histogram

Conversation

@thetalkingdrum

Copy link
Copy Markdown
Contributor

Summary

  • The Analysis chart's density histogram only ever showed one merged luma
    trace, so a channel that clipped or sat far from the others (a strong
    color cast in the scan) was invisible until it showed up in the print.
  • It now bins per channel on both engines — CPU (density_histogram()) and
    GPU (density_hist.wgsl) — matching the (4, N) [R, G, B, L] shape the
    output histogram already uses, with a CPU/GPU parity test alongside it.
  • The split only shows up under Peek Negative (M on this fork after
    fix(shortcuts): give Peek Flat Scan its own key, M, instead of | #912). Everywhere else the print's own output histogram already carries
    color information, so the density histogram stays the single merged luma
    trace it's always been — no visual change to the normal Analysis chart.
    Each channel is scaled to its own peak, so a spike pinned to an edge bin
    is that channel clipping, and a trace sitting apart from the others is a
    color cast.

Test plan

  • make all (lint + type check + full test suite, 4234 passed)
  • New/updated tests: tests/test_exposure_analysis.py (per-channel
    binning + GPU/CPU parity), tests/test_readout_and_curve_feedback.py
    (channel/luma-only paint toggle), tests/test_density_histogram_channel_wiring.py
    (Peek Negative wiring)
  • Verified live in the app: loaded a frame, confirmed the normal view
    still shows the single merged trace, toggled Peek Negative and
    confirmed the R/G/B/L split renders with visibly distinct peaks

🤖 Generated with Claude Code

thetalkingdrum and others added 13 commits August 7, 2026 23:10
The Analysis chart's density histogram only ever showed one merged
luma trace, so a channel that clipped or sat far from the others (a
strong color cast) was invisible until it showed up in the print. It
now bins per channel on both engines, matching how the output
histogram already works.

The R/G/B/L split only earns its place where there is no print
histogram doing that job already: Peek Negative. Everywhere else the
density histogram stays a single merged luma trace, as before.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@marcinz606
marcinz606 merged commit 5e1f436 into marcinz606:main Aug 19, 2026
1 check passed
@thetalkingdrum
thetalkingdrum deleted the feat/per-channel-density-histogram branch August 20, 2026 05:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants